#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>

char* my_strncat(char* dest, const char* src,size_t num)
{
	assert(dest && src);
	char* str = dest;
	while (*dest)
	{
		dest++;
	}
	while ((*dest++ = *src++)&& --num )
	{
		;
	}
	*dest = '\0';
	
	return str;
}



int main()
{
	char str1[] = "abcd";
	char str2[20] = "x\0xxxxx";
	char* s = my_strncat(str2, str1,47);
	printf("%s", s);
	return 0;
}